FrontMen - Hours registration
- Node 12 or higher - Dev platform
- Yarn version 1 - Package manager
- Vercel CLI - for running with lambdas
Clone this repo and install the dependencies:
yarn install
Create a .env
based on .env.defaults
. You can reach one of the team members for the credentials, or, if you have access to Vercel, get it from there.
๐ก Be sure you're using development keys.
Since this project uses Vercel's lambda functions (via /api
), instead of using the traditional yarn dev
, you'll need to use Vercel CLI
.
After doing login, run:
yarn vercel
It might ask you some questions about the project like Organization and if you want to link an existing project.
After that, a .vercel
folder will be created with some sensitive files and a server will be boot and up running at http://localhost:3000
๐ก .vercel folder should never be commit.
This project uses Nuxt, targeting static web app. To create a build you simply have to run:
yarn build
This command will run a build and generate the static assets in dist
folder.
For every single request which needs to be made server-side, we use Serverless Functions
from Vercel.
To add a new one, create a new file under /api/
folder with the route name:
.
โโโ api
โโโ auth.ts
Then you're good. Now, be able to reach this endpoint via https://<preview-url>/api/auth
.
Do not forget to add unit tests to ensure it's working as you expect ๐