This is a Next.js project bootstrapped with create-next-app
.
Technologies need before anything else (for super newbie)
Download the following:
For Windows only.
GITBASH: https://git-scm.com/downloads
MongoDB: https://www.mongodb.com/try/download/community
NodeJS(LTS): https://nodejs.org/en/
First check if you have existing SSH key: https://docs.github.com/en/github/authenticating-to-github/checking-for-existing-ssh-keys
Otherwise create one here: https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account
Now if you have your SSH key installed check it here: C:\Users\admin.ssh
- Open your SSH key with notepad and copy key to clipboard
- Go to Github login. In the upper-right corner of any page, click your profile photo, then click Settings.
- In the user settings sidebar, click "SSH and GPG keys".
- Click New SSH key or Add SSH key.
- In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
- Paste your key into the "Key" field.
- Click Add SSH key.
- If prompted, confirm your GitHub password.
- Create a folder or directory in your C: drive.
- Open Gitbash and type
"cd" then your created folder or directory
- Go to Github search for the repository.
- Click "CODE" then select "SSH" on the tab selection.
- Copy the link and go back to Gitbash.
- Type
git clone
and the link you copied from Github.
First, run the development server in this order:
- Open
CMD
thencd
then repository directory. - Create .env file by using the command 'touch .env'.
- Now open .env.example file using command 'open .env.example'.
- Copy all the content of .env.example and paste it into .env file.
- Type
mongod
. - Type
npm install
thennpm run dev
.
docker-compose up -d
npm run dev
npm run migrate:up
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
For backend we are using Next Connect through NextJS API Routes
All db functions should be tested.
To test all files run npm run test
To test a single file run npm run test <relative path>
To create migrations you need to have migrate-mongo installed globally.
To create a migration run migrate-mongo create <file_name>
To convert svgs to React components
Use stdin / stdout, run:
npx @svgr/cli < bronze.svg > Bronze.js