To get a local copy up and running, please follow these simple steps.
Here is what you need to be able to run the project.
If you want to enable any of the available integrations, you may want to obtain additional credentials for each one. More details on this can be found below under the integrations section.
Clone the repo into a public GitHub repository (or fork https://github.com/dammy001/express-ts-starter/fork).
git clone https://github.com/dammy001/express-ts-starter.git
If you are on windows, run the following command on
gitbash
with admin privileges: >git clone -c core.symlinks=true https://github.com/dammy001/express-ts-starter.git
Go to the project folder
cd express-ts-starter
Install packages with pnpm
pnpm i
Set up your .env
file
.env.example
to .env
openssl rand -base64 32
to generate a key and add it under SECRET_KEY
in the .env
file.pnpm docker:compose
- Requires Docker and Docker Compose to be installed
- Will start a local Postgres and Redis instance with a few test users.
pnpm docker:compose
Configure environment variables in the .env
file. Replace <user>
, <pass>
, <db-host>
, and <db-port>
with their applicable values
DATABASE_URL='postgresql://<user>:<pass>@<db-host>:<db-port>'
Download and install postgres in your local (if you don't have it already).
Create your own local db by executing createDB <DB name>
Now open your psql shell with the DB you created: psql -h localhost -U postgres -d <DB name>
Now extract all the info and add it to your DATABASE_URL. The url would look something like this
postgresql://postgres:postgres@localhost:5432/Your-DB-Name
.
Set up the database using the Prisma schema (found in packages/prisma/schema.prisma
)
In a development environment, run:
pnpm db:migrate
In a production environment, run:
pnpm db:deploy
Run (in development mode)
pnpm run dev
Open Prisma Studio to look at or modify the database content:
pnpm run db:studio
Click on the User
model to add a new user record.
Fill out the fields email
, userName
, firstName
, lastName
and click Save 1 Record
to create your first user.
You might want to adjust this behavior to your needs in the
prisma/schema.prisma
file.
# In a terminal just run:
pnpm test