---
title: "Manual installation"
section: "start"
platforms: ["android", "angular", "flutter", "javascript", "nextjs", "react", "react-native", "swift", "vue"]
gen: 2
last-updated: "2024-10-28T20:46:05.000Z"
url: "https://docs.amplify.aws/react/start/manual-installation/"
---

To get started with AWS Amplify we recommend that you use our [quickstart](/[platform]/start/quickstart) starter template. However, for some use cases, it may be preferable to start from scratch, either with a brand new directory or an existing frontend app. In that case we recommend to use [npm](https://npmjs.com) with [`create-amplify`](https://www.npmjs.com/package/create-amplify). 

```bash title="Terminal" showLineNumbers={false}
npm create amplify@latest
```

```console title="Terminal" showLineNumbers={false}
? Where should we create your project? (.) # press enter
```

Running this command will scaffold a lightweight Amplify project in your current project with the following files:

```text
├── amplify/
│   ├── auth/
│   │   └── resource.ts
│   ├── data/
│   │   └── resource.ts
│   ├── backend.ts
│   ├── tsconfig.json
│   └── package.json
├── node_modules/
├── .gitignore
├── package-lock.json
├── package.json
└── tsconfig.json
``` 

 If needed, you can manually install AWS Amplify without using `create-amplify` or the starter template. This guide will walk you through how to initialize your project, install dependencies, and author your first backend.

## Manual setup

First, if your frontend framework of choice doesn't have it already, create your project's `package.json` with `npm init -y`. Then, install the Amplify dependencies for building a backend:

```bash title="Terminal" showLineNumbers={false}
npm add --save-dev @aws-amplify/backend@latest @aws-amplify/backend-cli@latest typescript
```

> **Info:** **Note**: TypeScript is not a requirement but is recommended for an optimal experience.

Next, create the entry point for your backend, `amplify/backend.ts`, with the following code:

```ts
import { defineBackend } from '@aws-amplify/backend';

defineBackend({});
```

Now you can run `npx ampx sandbox` to create your first backend!

> **Warning:** Amplify Gen 2 requires your backend to be configured for use with [ECMAScript modules (ESM)](https://nodejs.org/api/esm.html). If you encounter the following error during `ampx sandbox`, consider modifying your `package.json` with `"type": "module"`:
> 
> ```text
The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@aws-amplify/backend")' call instead.
```
> 
> Or, you can create a local file in the Amplify backend directory, `amplify/package.json`:
> 
> ```json
{
  "type": "module"
}
```

You can use `define*` functions to _define_ your resources. For example, you can define authentication:

```ts title="amplify/auth/resource.ts"
import { defineAuth } from '@aws-amplify/backend';

export const auth = defineAuth({
  loginWith: {
    email: true
  }
});
```

Or define your data resource:

```ts title="amplify/data/resource.ts"
import { a, defineData, type ClientSchema } from '@aws-amplify/backend';

const schema = a.schema({
  Todo: a.model({
      content: a.string(),
      isDone: a.boolean()
    })
    .authorization(allow => [allow.publicApiKey()])
});

export type Schema = ClientSchema<typeof schema>;
export const data = defineData({
  schema
});
```

Each of these newly defined resources are then imported and set in the backend definition:

```ts title="amplify/backend.ts"
import { defineBackend } from '@aws-amplify/backend';
import { auth } from './auth/resource';
import { data } from './data/resource';

defineBackend({
  auth,
  data
});
```

## Upgrade existing projects

You can also update an existing frontend app. To upgrade existing Amplify code-first DX (Gen 2) apps, use your Node.js package manager (for example, `npm`) to update relevant backend packages:

```bash title="Terminal" showLineNumbers={false}
npm update @aws-amplify/backend @aws-amplify/backend-cli
```

## Next steps

We recommend the following next steps:

- [Learn more about defining authentication](/[platform]/build-a-backend/auth)
- [Learn more about defining data](/[platform]/build-a-backend/data)
- [Get started with cloud sandbox](/[platform]/deploy-and-host/sandbox-environments)
- [Deploy and host your first app](/[platform]/deploy-and-host/fullstack-branching)
