Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jossdoe/next-magic-boilerplate
A template for Next.js projects, includes basic set-up for Magic Authentication, MongoDB, Styled Components and an optimized Context-pattern.
https://github.com/jossdoe/next-magic-boilerplate
context-api magic mongodb mongoose nextjs styled-components
Last synced: 9 days ago
JSON representation
A template for Next.js projects, includes basic set-up for Magic Authentication, MongoDB, Styled Components and an optimized Context-pattern.
- Host: GitHub
- URL: https://github.com/jossdoe/next-magic-boilerplate
- Owner: jossdoe
- License: mit
- Created: 2020-12-07T10:10:36.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-15T16:23:21.000Z (almost 4 years ago)
- Last Synced: 2023-08-02T02:29:07.995Z (over 1 year ago)
- Topics: context-api, magic, mongodb, mongoose, nextjs, styled-components
- Language: JavaScript
- Homepage:
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Next.js App Template
This repo is based on the official [Magic example repo](https://github.com/vercel/next.js/tree/canary/examples/with-magic) by Vercel/Next.js.
Additions in this template:
- MongoDB set-up with mongoose
- Styled Components
- Optimized Context-pattern included
- Absolute imports/aliases (see jsconfig.json)
- Changes to file/folder structure## Getting started
- Use the template function on GitHub and clone your repo
- Run `npm i`
- Create a file at the root and name it `.env.local`
- Populate it with these variables:```
NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY=
MAGIC_SECRET_KEY=
TOKEN_SECRET=
MONGODB_URI=
```- Get `NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY` and `MAGIC_SECRET_KEY` from your dashboard at [Magic](https://magic.link/)
- `TOKEN_SECRET` needs to be some arbitrary value with at least 32 characters
- `MONGODB_URI` is the connection to your database
- `npm run dev` 🚀