Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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` 🚀