Service is responsible to handle user authentication and registration.
- Docker is required for database setup. (installation).
- Node.js 18.x.x or above. (installation).
- Pnpm is needed as package manager (installation).
-
Clone this repository
-
In project's root directory create two files
integrations.env
- used by docker-compose to pass some config to postgresql and pgadmin containers.
# these credentials can be used to login to pgadmin web app running locally. [email protected] PGADMIN_DEFAULT_PASSWORD=12345 # Postgresql config , these will be default user/pass credentials POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres
.env
- used by application to load config
PORT=5000 SECRET=<hext secret> DB_USER=postgres DB_PASS=postgres DB_NAME=rollsync-auth-db DB_PORT=5432 DB_HOST=db
-
Run following in terminal in project root
> docker compose up
-
To stop , press
CTRL+C
in terminal.
3 containers run when you run docker compose up
.
db
- postgresql database container.pgadmin
- GUI for postgresql database.api
- this service's container.
when you run docker compose up
for first time, it will start fresh containers. You will need to add configuration to
PgAdmin tool to see the database.
-
After containers are started go to http://localhost:8888.
-
Login using
PGADMIN_DEFAULT_EMAIL
andPGADMIN_DEFAULT_PASSWORD
fromintegrations.env
. -
On the right hand side menu, right click
Servers -> Register -> Server
. -
In modal popup under
General
tab, give any name of your choice. -
Under
Connection
tab, provide values forhost
,port
,username
,password
from.env
file and hit save. -
Now the database should be visible in the left pane under
Servers
, for more info visite tool docs or look around. -
Once this first time setup is done, next time you start
docker compose up
will not require this setup again.
For debugging during development you can use VSCode debugger
.
-
First build the application locally (Although locally building is not needed with Docker, this allows setting up proper breakpoints), to build you run,
> pnpm run build
-
Start the containers
> docker compose up
-
Setup your breakpoints as needed
-
Start the Debugger by pressing
Ctrl+Shift+D
or navigate toRun & Debug
, from the dropdown selectDocker: Attach to container
option and hit green play button. -
If everything goes well, you shoud see debugger controlls and you can debug.
Once container is running you can visit http://localhost:5000/docs to see swagger docs.
-
main
is the production branch, all issue/feature branches will be created frommain
branch. -
Take an issue you want to implement.
-
Create a branch from
main
for this issue -
Checkout the branch locally and do your work.
-
Once done push your changes and open a PR to merge into
main
. -
Once PR is approved by atleast 1 person, it can be merged.
This Project is using Biome as Linter,formatter & Code analysis tool. Before you push your changes make sure you run ,
> pnpm run check
This runs a linter, formatter & code analysis tool. Please fix all linter errors , once you see message like below, you can push.
if you want to do linting and formatting separately then you can run below and fix separately.
> pnpm run format
> pnpm run lint